#
# faces.master.R
#
# Master script that sources relevant scripts
# to create tables and graphs in Atkinson, Enos, & Hill
# "Candidate Faces and Election Outcomes."
#
# Note: On Windows, set working directory at level of archive.
#
# Requires R libraries lattice, foreign, Zelig, Hmisc, lmtest,
#                       MSBVAR, and sandwich.
#

rm( list = ls() )
toEPS <- T          # Save graphics to eps, or display in R GUI?

# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
# Before the exit poll component of the analysis can be replicated, the user
# must download the relevant exit poll data sets from the Roper Center's online
# archive (www.ropercenter.uconn.edu) and place them in the exitpolls/ folder.
# The terms of use do not allow us to redistribute the data.
# As of the date of this writing, the Roper Center exit poll data is available 
# at this address: www.ropercenter.uconn.edu/elections/common/exitpolls.html.  
# The following are exit poll data sets called by the replication script (faces.exit.poll.R):
#     2006 National Election Pool:    usmi2006-natelec.por
#     2004 National Election Pool:    usmi2004-natelec.por
#     2002 Voter News Service:        vns2002.por
#     2000 Voter News Service:        usvns2000-natelec.por
#     1998 Voter News Service:        vns1998.dat
#     1996 Voter News Service:        vns1996.dat
#     1994 Voter News Service:        vns1994.dat
#     1992 Voter Research and Surveys:vrs1992.dat
# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

# Predicting Candidate Facial Competence.
source("predicting.competence.R")

# Set up exit poll data.
source("setup.exit.poll.R")

# Effect of Facial Competence on Individual-level vote choice.
source("faces.exit.poll.R")

# Estimate the effect of faces on Senate election outcomes.
source("PredictFaceEffectInSenateContests.R")

# Replication of Todorov et al. Competence Scores (Appendix Figure).
source("replicate.house.R")
source("replicate.senate.R")
